//
//  NetworkTools.h
//  Weibo-OC
//
//  Created by 焦林生 on 15/11/26.
//  Copyright © 2015年 cn.baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AFNetworking/AFNetworking.h>

//网络请求回调
typedef void (^RequestCallBack)(id, NSError *);

//网络请求枚举
typedef enum : NSUInteger {
    GET,
    POST,
    
} RequestMethod;

@interface NetworkTools : AFHTTPSessionManager

//单例
+ (instancetype)sharedTools;

- (NSURL *)OAuthURL;

- (void)request:(RequestMethod)method URLString:(NSString *)URLString parameters:(id)parameters finished:(void(^)(id result, NSError *error))finished;

- (void)loadAccessToken:(NSString *)code finished:(RequestCallBack)finished;

@end
